<%-- 
    Document   : index
    Created on : 16-ene-2012, 22:11:49
    Author     : familia
--%>

<%@page import="Logica.UsuarioXml"%>
<%@page import="Beans.Usuario"%>
<%@page import="java.util.*" session="true"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% 


String actionMethod=request.getMethod();
String url=request.getRequestURI().toString();
if(actionMethod.equalsIgnoreCase("post")){
    String nombre = request.getParameter("nombre");
    String password = request.getParameter("password");
    Usuario usuario = new Usuario();
    usuario.setLogin(nombre);
    usuario.setPassword(password);
    UsuarioXml xml = new UsuarioXml();
    if(xml.ValidarUsuario(usuario))
        response.sendRedirect("PaginaPrincipal.jsp");
    else{ %>
        <script>alert('Credenciales invalida');</script>
       <%}
}
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>Proyecto Distribuido</title>
	<link href="css/style.css" rel="stylesheet" type="text/css"> 
	</head>
	
	<body>
	<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
	<tbody><tr>
	<td>
	<table width="1000" border="0" cellspacing="0" cellpadding="0">
	<tbody><tr>
	<td background="images/top-bg.jpg"><div width="337" height="107"> <h1 style="font-size:40px"> Sistemas Distribuidos</h1> </div>
	  <table width="284" border="0" align="right" cellpadding="0" cellspacing="0">
	    <tbody>
	      
	      
	      </tbody></table>	  </td>
	</tr>
	</tbody></table>
	</td>
	</tr>
	
	<tr>
	<td id="button-bg">
	<ul>
	<li><a href="#" class="highlight-button" >Iniciar Sesi&oacute;n</a></li>
	</ul>
	</td>
	</tr>
	<tr>
	<td bgcolor="#ddeefe">
	<table width="1000" border="0" cellspacing="0" cellpadding="0">
	<tbody><tr>
	<td width="15" height="15"></td>
	<td></td>
	<td width="15" height="15"></td>
	<td></td>
	<td width="15" height="15"></td>
	</tr>
	<tr>
            <td colspan="5" valign="top" align ="center">
	<h1><img src="images/arrow.jpg" alt="" width="14" height="10" hspace="4" vspace="2"> Iniciar Sesi&oacute;n </h1>
	<form name="form1" method="post" action="index.jsp">
	    <table width="200" border="0" >
	      <tr>
	        <td width="100">Login:</td>
	        <td width="100">
	          <label for="nombre"></label>
	          <input type="text" name="nombre" id="nombre" value="">
	          </td>
              </tr>
              <tr>
	        <td>Password:</td>
	        <td><label for="apellido"></label>
	          <input type="password" name="password" id="password" value=""></td>
	        </tr>
	      
	        <td colspan="4"><div align="center">
	          <input  type="submit" name="aceptar" id="aceptar" value="Aceptar">
	          </div></td>
	        </tr>
	      </table>
	    </form>
	 <br>
	<div align="left"
><a href="RespaldoPerdida.jsp"> Respaldo</a></div>	
	</td>
	</tr>
	</tbody></table>
	</td></tr>
	<tr>
	<td height="15" bgcolor="#DDEEFE"></td>
	</tr>
	<tr>
	<td class="footer-text"><a href="index.html">Home</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">About Us</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">Order</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">Affiliates</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">Newsletter</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">Contact Us</a><br>
	<span class="footer-text1">Copyright Â© 2009 domainforsale.com. All Rights Reserved</span></td>
	</tr>
	</tbody></table>
	
	
	
</body></html>
